import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'home',
    component: Home,
    children: [
      {
        path: '/user_center',
        name: 'userCenter',
        component: () => import('../views/UserCenter')
      },
      {
        path: '/index',
        name: 'index',
        component: () => import('../views/Index')
      },
      {
        path: '/sys/file',
        name: 'file',
        component: () => import('../views/sys/File')
      },
      {
        path: '/sys/menu',
        name: 'menu',
        component: () => import('../views/sys/Menu')
      },
      {
        path: '/sys/user',
        name: 'user',
        component: () => import('../views/sys/User')
      },
      {
        path: '/course/biology',
        name: 'biology',
        component: () => import('../views/course/Biology')
      },
      {
        path: '/course/chemistry',
        name: 'chemistry',
        component: () => import('../views/course/Chemistry')
      },
      {
        path: '/course/geography',
        name: 'geography',
        component: () => import('../views/course/Geography')
      },
      {
        path: '/article',
        name: 'article',
        component: () => import('../views/other/Article')
      },
      {
        path: '/bush',
        name: 'bush',
        component: () => import('../views/other/Bush')
      },
      {
        path: '/map',
        name: 'map',
        component: () => import('../views/other/Map')
      }
    ]
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('../views/Login')
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
